Migrate Kafka core messaging telemetry to v1.43 preview#19270
Conversation
Pull request dashboard statusStatus last refreshed: 2026-07-22 16:49:35 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. |
ebb9535 to
28f4d0b
Compare
There was a problem hiding this comment.
Pull request overview
Migrates Kafka core messaging telemetry to the v1.43 preview semantic conventions while preserving legacy and dual-emission modes.
Changes:
- Adds v1.43 messaging attributes, span names/kinds, metrics, and topology support.
- Migrates Kafka clients and Connect instrumentation.
- Expands compatibility bridges and preview-mode tests.
Reviewed changes
Copilot reviewed 53 out of 53 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
testing-common/.../SemconvMessagingStabilityUtil.java |
Adds test key compatibility. |
.../testing/AgentSpanTestingInstrumenter.java |
Includes new span keys. |
.../ContextBridgeTest.java |
Tests new bridged keys. |
.../SpanKeyBridging.java |
Bridges optional new keys. |
.../PostgresKafkaConnectSinkTaskTest.java |
Updates Connect assertions. |
.../MongoKafkaConnectSinkTaskTest.java |
Updates Connect assertions. |
.../KafkaConnectSinkTaskBaseTest.java |
Adds preview test helpers/configuration. |
kafka-connect-2.6/testing/build.gradle.kts |
Adds preview test task. |
.../KafkaConnectSingletons.java |
Uses v1.43 messaging extractors. |
.../TracingIterator.java |
Cleans leaked process parents. |
.../KafkaReceiveAttributesExtractor.java |
Emits current consumer-group attribute. |
.../KafkaInstrumenterFactory.java |
Migrates Kafka instrumenters and topology. |
.../KafkaConsumerContextUtil.java |
Adds leaked-span cleanup. |
.../KafkaConsumerAttributesExtractor.java |
Migrates consumer-group attributes. |
.../WrapperTest.java |
Tests preview wrapper telemetry. |
.../WrapperSuppressReceiveSpansTest.java |
Reuses shared preview assertions. |
.../WrapperSendExceptionTest.java |
Updates send-span naming. |
.../WrapperPropagationDisabledTest.java |
Updates preview span names. |
.../InterceptorsSuppressReceiveSpansTest.java |
Tests preview interceptor attributes. |
.../AbstractInterceptorsTest.java |
Updates interceptor topology assertions. |
.../KafkaConsumerTelemetry.java |
Changes receive/process parenting. |
kafka-clients-2.6/library/build.gradle.kts |
Adds v3-preview tests. |
.../KafkaClientBaseTest.java |
Adds dual-mode attribute assertions. |
.../KafkaClientDefaultTest.java |
Tests links, parenting, and cleanup. |
.../KafkaConsumerInstrumentation.java |
Migrates poll/process contexts. |
kafka-clients-0.11/javaagent/build.gradle.kts |
Adds preview test variants. |
.../SemconvStabilityTest.java |
Tests messaging selection modes. |
.../SpanKey.java |
Adds create and settle keys. |
.../SemconvStability.java |
Clarifies messaging preview behavior. |
.../MessagingSpanNameExtractorTest.java |
Expands v1.43 naming tests. |
.../MessagingSpanKindExtractorTest.java |
Tests operation span kinds. |
.../MessagingProducerMetricsTest.java |
Tests producer metrics migration. |
.../MessagingProcessMetricsTest.java |
Tests process-duration metrics. |
.../MessagingMetricsAdviceTest.java |
Tests cardinality filtering. |
.../MessagingConsumerMetricsTest.java |
Tests consumer preview metrics. |
.../MessagingAttributesExtractorTest.java |
Tests new attributes and keys. |
.../MessagingProcessInstrumenterFactoryTest.java |
Tests process topology selection. |
.../MessagingProcessContextCustomizerTest.java |
Tests process parent selection. |
.../MessagingSpanNameExtractorBuilder.java |
Adds configurable operation names. |
.../MessagingSpanNameExtractor.java |
Implements v1.43 span naming. |
.../MessagingSpanKindExtractor.java |
Implements v1.43 span kinds. |
.../MessagingProducerMetrics.java |
Adds preview producer metrics. |
.../MessagingProcessMetrics.java |
Adds process-duration metric. |
.../MessagingOperationType.java |
Defines v1.43 operation types. |
.../MessagingMetricsAdvice.java |
Defines metric attribute advice. |
.../MessagingConsumerMetrics.java |
Adds preview consumer metrics. |
.../MessagingAttributesGetter.java |
Adds error-type extraction. |
.../MessagingAttributesExtractorBuilder.java |
Supports operation type/name configuration. |
.../MessagingAttributesExtractor.java |
Emits v1.43 messaging attributes. |
.../MessageOperation.java |
Maps legacy operations to new types. |
.../MessagingProcessInstrumenterFactory.java |
Centralizes process instrumenter topology. |
.../MessagingProcessContextCustomizer.java |
Preserves ambient or producer context. |
instrumentation-api-incubator/build.gradle.kts |
Enables messaging preview test modes. |
28f4d0b to
3751ed8
Compare
9d30879 to
93a5642
Compare
93a5642 to
b8da039
Compare
b8da039 to
8569cb1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 55 out of 55 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
instrumentation/kafka/kafka-clients/kafka-clients-common-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/common/v0_11/internal/KafkaInstrumenterFactory.java:117
- [General]
producerPropagationEnabledis not the full condition used by the javaagent to inject the send span context.KafkaProducerInstrumentation.java:83-86also requiresKafkaPropagation.shouldPropagate(apiVersions), which is false when the broker only supports record magic below v2. In that supported configuration no creation context is injected, but this fixed extractor still emits a stablePRODUCERspan instead of the v1.43-requiredCLIENTspan. Carry the per-send propagation decision intoKafkaProducerRequest(the advice already hasapiVersionsbefore starting the span) and derive the kind from that actual decision.
8569cb1 to
dd3c636
Compare
c87b7cf to
54b2e58
Compare
54b2e58 to
d4e1597
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 60 out of 60 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
instrumentation/kafka/kafka-clients/kafka-clients-common-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/common/v0_11/internal/KafkaConsumerContextUtil.java:49
- [General] This replaces only the context's current span; it leaves
SpanKey.CONSUMER_PROCESSpointing at the abandoned process span. With the default semconv suppression strategy, any process instrumenter that callsshouldStart()against this returned context still sees an active process key and is incorrectly suppressed. Restore or clear the process span key together with the ambient span (while preserving an outer process key if the original parent had one).
d4e1597 to
247edef
Compare
247edef to
e197acc
Compare
e197acc to
4ab6c6e
Compare
4ab6c6e to
cd9360e
Compare
Depends on #19268.
Dependency baseline:
9b5ec57607668f417ce57a15c2281897fcb3f774.Review only:
9b5ec57607668f417ce57a15c2281897fcb3f774..cd9360e14660d61ce7739ca4a41d9e4de17e6bd6.Exactly one Kafka core/Connect commit. Explicit receive opt-outs are preserved; producer span kind follows actual configured trace-context propagation and per-send injection; abandoned iterator cleanup is suppression-strategy independent. Kafka Connect stable assertions ignore only scheduler-dependent standalone poll traces while keeping all application/status/DB/HTTP traces exact.
Validated: complete Kafka library/javaagent stable suites, including stable receive-disabled coverage; Kafka Connect preview (Mongo/Postgres single/multi); propagator and leak-cleanup tests; full Kafka clients javaagent
check; and Spotless.